package com.example.test.util;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Reflect {

    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class desUtilClass = Class.forName("com.example.test.util.DesUtil");
        Object desUtilObj = desUtilClass.getConstructor().newInstance();
        System.out.println(desUtilObj);
        Method encryptDES = desUtilClass.getMethod("encryptDES",String.class,String.class);
        System.out.println(encryptDES.invoke(desUtilObj,"abc","MFLADFKIOJFADNFD"));
        System.out.println(desUtilClass.getName());
    }


}
